import webbrowser

webbrowser.open("https://tool.oschina.net/regex")

# 验证包含数字：\d
# 验证数字：^\d$
# 验证包含电话号码：\d{11}
# 验证电话号码：^\d{11}$

webbrowser.open(r"https://www.bilibili.com/video/BV1bL4y1V7q1?p=18&spm_id_from=pageDriver&vd_source=68df6813c38a66d11af23b69a41d5fb9")
print("重要元字符：")
print('''[
    r".",
    r"\w",
    r"\d",
    r"^",
    r"$",
    r"a|b",
    r"[abc]",
    r"[^abc]",
    r"[0-9a-zA-Z_]"
]''')

webbrowser.open(r"https://www.bilibili.com/video/BV1bL4y1V7q1?p=19&spm_id_from=pageDriver&vd_source=68df6813c38a66d11af23b69a41d5fb9")
print("量词：")
print('''[
    r"\d*",
    r"\d+",
    r"\d?",
    r"\d{5}",
    r"\d{5,}",
    r"\d{5,10}"
]''')

webbrowser.open(r"https://www.bilibili.com/video/BV1bL4y1V7q1?p=20&spm_id_from=pageDriver&vd_source=68df6813c38a66d11af23b69a41d5fb9")
print("贪婪匹配与惰性匹配：")
print('''[
    r".*",
    r".*?"
]''')
